home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / AOCE folder / ADSPSecure.lisp next >
Encoding:
Text File  |  1994-09-12  |  5.2 KB  |  151 lines  |  [TEXT/CCL2]

  1.  
  2. (in-package :TRAPS)             ; ***********************************************************
  3. ; Created: Sunday, February 7, 1993 at 4:54PM
  4. ;  ADSPSecure.p
  5. ;  Pascal Interface to the Macintosh Libraries
  6. ;     ••• Apple Confidential •••
  7. ;     ••• Provided with AOCE Beta seed under license agreement with   •••
  8. ;     ••• Apple Computer, Inc.  Use for any purpose other than        •••
  9. ;     ••• development of AOCE-based Macintosh products is a violation •••
  10. ;     ••• of the license agreement.                                   •••
  11. ;   Copyright Apple Computer, Inc. 1990-1993
  12. ;   All rights reserved
  13. ; ***********************************************************
  14.  
  15. ; $IFC UNDEFINED UsingIncludes
  16. ; $SETC UsingIncludes:= 0
  17. ; $ENDC
  18.  
  19. ; $IFC NOT UsingIncludes
  20.  
  21. ; $ENDC
  22.  
  23. ; $IFC UNDEFINED UsingADSPSecure
  24. ; $SETC UsingADSPSecure:= 1
  25.  
  26. ; $I+
  27. ; $SETC ADSPSecureIncludes:= UsingIncludes
  28. ; $SETC UsingIncludes:= 1
  29.  
  30. ; $IFC UNDEFINED UsingADSP
  31.  
  32. (require-interface 'ADSP)       ; $I $$Shell(PInterfaces)ADSP.p
  33. ; $ENDC
  34.  
  35. ; $IFC UNDEFINED UsingFiles
  36.  
  37. (require-interface 'FILES)      ; $I $$Shell(PInterfaces)Files.p
  38. ; $ENDC
  39.  
  40. ; $IFC UNDEFINED UsingOCE
  41. ; $I OCE.p
  42. ; $ENDC
  43.  
  44. ; $IFC UNDEFINED UsingOCEAuthDir
  45. ; $I OCEAuthDir.p
  46. ; $ENDC
  47.  
  48. ; $IFC UNDEFINED UsingTypes
  49.  
  50. (require-interface 'TYPES)      ; $I $$Shell(PInterfaces)Types.p
  51. ; $ENDC
  52.  
  53. ; $SETC UsingIncludes:= ADSPSecureIncludes
  54.  
  55. ;  New ADSP control codes 
  56.  
  57. (defconstant $sdspOpen 229)     ;  open a secure connection 
  58.  
  59. ; For secure connections, the eom field of ioParams contains two single-bit flags
  60. ; (instead of a zero/non-zero byte). They are an encrypt flag (see below), and an
  61. ; eom flag.  All other bits in that field should be zero.
  62. ; To write an encrypted message, you must set an encrypt bit in the eom field of
  63. ; the ioParams of your write call. Note: this flag is only checked on the first
  64. ; write of a message (the first write on a connection, or the first write following
  65. ; a write with eom set.
  66.  
  67. (defconstant $dspEOMBit 0)      ;  set if EOM at end of write 
  68. (defconstant $dspEncryptBit 1)  ;  set to encrypt message 
  69.  
  70. (defconstant $dspEOMMask #X1)   ; 1<<dspEOMBit
  71. (defconstant $dspEncryptMask #X2); 1<<dspEncryptBit
  72.  
  73. ; Define an ADSPSecure parameter block, as used for the secure Open call.
  74.  
  75. (defconstant $sdspWorkSize 2048);  size of ADSPSecure workspace 
  76.  
  77. (defrecord TRSecureParams 
  78.    (localCID :SIGNED-INTEGER)   ;  local connection id 
  79.    (remoteCID :SIGNED-INTEGER)  ;  remote connection id 
  80.    (remoteAddress :ADDRBLOCK)   ;  address of remote end 
  81.    (filterAddress :ADDRBLOCK)   ;  address filter 
  82.    (sendSeq :SIGNED-LONG)       ;  local send sequence number 
  83.    (sendWindow :SIGNED-INTEGER) ;  send window size 
  84.    (recvSeq :SIGNED-LONG)       ;  receive sequence number 
  85.    (attnSendSeq :SIGNED-LONG)   ;  attention send sequence number 
  86.    (attnRecvSeq :SIGNED-LONG)   ;  attention receive sequence number 
  87.    (ocMode :UNSIGNED-BYTE)      ;  open connection mode 
  88.    (ocInterval :UNSIGNED-BYTE)  ;  open connection request retry interval 
  89.    (ocMaximum :UNSIGNED-BYTE)   ;  open connection request retry maximum 
  90.  
  91. ; ERROR!! Record field SECURE declared PACKED BOOLEAN !
  92.    (secure :BOOLEAN)            ;   --> TRUE if session was authenticated 
  93.    (sessionKey (:POINTER :AUTHKEY));  <--> encryption key for session 
  94.    (credentialsSize :SIGNED-LONG);   --> length of credentials 
  95.    (credentials :POINTER)       ;   --> pointer to credentials 
  96.    (workspace :POINTER)         ;   --> pointer to workspace for connection 
  97. ;  align on even boundary and length = sdspWorkSize 
  98.    (recipient :SIGNED-LONG)     ;   --> identity of recipient (or initiator if active mode 
  99.    (issueTime :SIGNED-LONG)     ;   --> when credentials were issued 
  100.    (expiry :SIGNED-LONG)        ;   --> when credentials expiry 
  101.    (initiator (:POINTER :RECORDID));  <--  RecordID of initiator returned here.
  102. ;                                             Must give appropriate Buffer to hold RecordID
  103. ;                                             (Only for passive or accept mode) 
  104.  
  105. ; ERROR!! Record field HASINTERMEDIARY declared PACKED BOOLEAN !
  106.    (hasIntermediary :BOOLEAN)   ;  <--  will be set if credentials has an intermediary 
  107.    (intermediary (:POINTER :RECORDID));  <--  RecordID of intermediary returned here.
  108. ;                                             (If intermediary is found in credentials
  109. ;                                             Must give appropriate Buffer to hold RecordID
  110. ;                                             (Only for passive or accept mode) 
  111.    )
  112.  
  113. (defrecord SDSPParamBlock 
  114.    (:variant 
  115.       ((DSPParamBlock :DSPPARAMBLOCK))
  116.       ((qLink (:POINTER :QELEM))
  117.       (qType :SIGNED-INTEGER)
  118.       (ioTrap :SIGNED-INTEGER)
  119.       (ioCmdAddr :POINTER)
  120.       (ioCompletion :POINTER)
  121.       (ioResult :SIGNED-INTEGER)
  122.       (ioNamePtr (:POINTER (:STRING 255)))
  123.       (ioVRefNum :SIGNED-INTEGER)
  124.       (ioCRefNum :SIGNED-INTEGER);  adsp driver refNum 
  125.       (csCode :SIGNED-INTEGER)  ;  adsp driver control code 
  126.       (qStatus :SIGNED-LONG)    ;  adsp internal use 
  127.       (ccbRefNum :SIGNED-INTEGER);  connection end refNum 
  128.       (secureParams :TRSECUREPARAMS);  dspOpenSecure 
  129.       )
  130.       ))
  131.  
  132. (def-mactype :SDSPPBPTR (find-mactype :POINTER))
  133.  
  134. ; $ENDC                         ;  UsingADSPSecure 
  135.  
  136. ; $IFC NOT UsingIncludes
  137.  
  138. ; $ENDC
  139.  
  140. (export '($SDSPWORKSIZE $DSPENCRYPTMASK $DSPEOMMASK $DSPENCRYPTBIT $DSPEOMBIT
  141.           $SDSPOPEN))
  142. (provide-interface 'ADSPSecure)